:root {
  --wd-scrollbar-opacity: 0.3;
  --wd-text-color-secondary: #909399;
  --wd-scrollbar-background-color: var(--wd-text-color-secondary);
  --wd-scrollbar-hover-opacity: 0.5;
  --wd-scrollbar-hover-background-color: var(--wd-text-color-secondary);
}

.@{gx-prefix}-scrollbar {
  position: relative;
  height: 100%;
  overflow: hidden;

  &-wrap {
    height: 100%;
    overflow: auto;

    &-hidden-default {
      scrollbar-width: none;

      &::-webkit-scrollbar {
        display: none;
      }
    }
  }

  &-bar {
    position: absolute;
    right: 2px;
    bottom: 2px;
    z-index: 999;
    border-radius: 4px;

    &.is-vertical {
      top: 2px;
      width: 6px;

      & > div {
        width: 100%;
      }
    }

    &.is-horizontal {
      left: 2px;
      height: 6px;

      & > div {
        height: 100%;
      }
    }
  }

  &-thumb {
    position: relative;
    display: block;
    width: 0;
    height: 0;
    cursor: pointer;
    background-color: var(--wd-scrollbar-background-color);
    border-radius: inherit;
    opacity: var(--wd-scrollbar-opacity);
    -webkit-transition: var(--wd-transition-duration) background-color;
    transition: var(--wd-transition-duration) background-color;

    &:hover {
      background-color: var(--wd-scrollbar-hover-background-color);
      opacity: var(--wd-scrollbar-hover-opacity);
    }
  }

  &-fade-enter-active {
    -webkit-transition: opacity 340ms ease-out;
    transition: opacity 340ms ease-out;
  }

  &-fade-leave-active {
    -webkit-transition: opacity 120ms ease-out;
    transition: opacity 120ms ease-out;
  }
}

.@{gx-prefix}-scrollbar-fade-enter-from,
.@{gx-prefix}-scrollbar-fade-leave-active {
  opacity: 0;
}
